@extends('admin.layouts.index')
@section('title', '管理员列表')

@section('content')

<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">
                <div class="card-title">管理员列表<a href="{{ url('admin/admin/add') }}" class="btn btn-success btn-xs pull-right" style="color: #FFFFFF;">添加管理员</a></div>
            </div>
            <div class="card-body">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th scope="col">ID</th>
                            <th scope="col">姓名</th>
                            <th scope="col">账号</th>
                            <th scope="col">权限</th>
                            <th scope="col">状态</th>
                            <th scope="col">创建时间</th>
                            <th scope="col">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @forelse($admins as $admin)
                        <tr>
                            <td>{{ $admin->id }}</td>
                            <td>{{ empty($admin->name) ? $admin->nike : $admin->name }}</td>
                            <td>{{ $admin->username ?? "-" }}</td>
                            @if($admin->jurisdiction == 1)
                            <td class="text-info">管理</td>
                            @else
                            <td class="text-warning">高级管理</td>
                            @endif
                            @if($admin->disable == 1)
                            <td class="text-success">正常</td>
                            @else
                            <td class="text-danger">已禁用</td>
                            @endif
                            <td>{{ $admin->created_at }}</td>
                            <td><a href="{{ url('/admin/admin/disable',['id'=>$admin->id]) }}?disable={{ $admin->disable }}">禁用状态</a></td>
                        </tr>
                        @empty
                        <tr>
                            <td>暂无管理员！</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        @endforelse
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>


@endsection
